package edu.caltech.android.comm;

import java.util.ArrayList;

import edu.caltech.android.picking.Pick;
import edu.caltech.android.sensor.accel.AccelSample;
import edu.caltech.csn.data.CsnMessages;

public interface Comm {
	
	/**
	 * Send registration message, and process response
	 */
	public void register(double lat, double lon);
	
	/**
	 * Send pick message
	 */
	public void pick(Pick p, double latitude, double longitude);
	
	public void heartbeat(double latitude, double longitude, String parameterVersion);
	
	/**
	 * Send heartbeat message, and process response
	 */
	public void heartbeat(double latitude, double longitude,
			String parameterVersion, ArrayList<AccelSample> measurements);
	
	/**
	 * Retrieve and remove the next heartbeat response message
	 * @return the head of the queue, or null if the queue is empty
	 */
	public CsnMessages.HeartbeatResponse pollHeartbeatResponse();
	
	/**
	 * Retrieve and remove the next registration response message
	 * @return the head of the queue, or null if the queue is empty
	 */
	public CsnMessages.RegistrationResponse pollRegistrationResponse();
	
	// TODO: pick response?
	
	
	public String getClientName();

	public String getClientKey();
}
